package com.jsyl.lwbk.business.mapper;

import com.jsyl.lwbk.business.domain.EvaluateReport;
import com.jsyl.lwbk.business.dto.ChildListReportDTO;
import com.jsyl.lwbk.business.vo.ChildReportVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EvaluateReportMapper {

    int insert(EvaluateReport record);

    EvaluateReport selectById(Long id);

    int updateById(EvaluateReport record);

    /**
     * 根据evaluateNumber查询报告
     *
     * @param evaluateNumber
     * @return
     */
    EvaluateReport findByEvaluateNumber(@Param("evaluateNumber")String evaluateNumber);

    List<ChildReportVO> findByChildId(@Param("childId") Long childId,@Param("evaluateNumber") String evaluateNumber,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    EvaluateReport findLastEvaluateReport(@Param("childId") Long childId);

    EvaluateReport getLatestChildReport(@Param("childId") Long childId,@Param("beginTime") String beginTime,@Param("endTime") String endTime);


    EvaluateReport findByReportId(@Param("id")Long id);

    List<ChildListReportDTO> getChildListReport(@Param("childIds")List<String> childIds);

    /**
     * 查询当前测评是否是第一次测评
     * @param evaluateNumber
     * @return
     */
    int selectEvaluateCount(@Param("evaluateNumber")String evaluateNumber,
                            @Param("childId") Long childId);


    /**
     * 查询当前测评是否是第一次测评
     * @param evaluateNumber
     * @return
     */
    int delPreviewProgram(@Param("evaluateNumber")String evaluateNumber,
                            @Param("childId") Long childId);
}